package xiancheng;

public class Threadtest {
    public static void main(String[] args) {

        MyTheard myTheard=new MyTheard("xianchen");
        myTheard.start();

    }

    ////1.自定义多线程类
    static class MyTheard extends Thread{

        public MyTheard() {
            super();
        }

        public MyTheard(String name) {
            super(name);
        }

        @Override
        public void run() {
            for (int i = 1; i <=5 ; i++) {
                System.out.println(i+":"+getName());
            }
        }
    }

}
